﻿using System;
using System.Collections.Generic;
using System.Text;
using Flexible.Interfaces;

namespace Flexible.Implementions.Editors
{
    public class StringEditor : ISettingEditor
    {
        object value;

        #region ISettingEditor Members

        public object Editor
        {
            get { throw new NotImplementedException(); }
        }

        public bool IsValid
        {
            get { return true; }
        }

        public string ErrorMessage
        {
            get { return null; }
        }

        public object Value
        {
            get
            {
                if (value != null)
                    return value.ToString();
                else
                    return null;
            }
            set
            {
                this.value = value;
            }
        }

        public string ToStringFormat()
        {
            if (value == null)
                return null;
            return value.ToString();
        }

        #endregion
    }
}
